package com.nbsaas.sample.user.rest.convert;

import com.nbsaas.sample.entity.user.UserAccessLog;
import com.nbsaas.sample.user.api.domain.simple.UserAccessLogSimple;

import com.nbsaas.boot.rest.api.Converter;
/**
* 列表对象转换器
*/

public class UserAccessLogSimpleConvert implements Converter<UserAccessLogSimple, UserAccessLog> {




    @Override
    public UserAccessLogSimple convert(UserAccessLog source) {
        UserAccessLogSimple result = new UserAccessLogSimple();

                    result.setStoreState(source.getStoreState());
                    result.setIp(source.getIp());
                    result.setUrl(source.getUrl());
                    result.setLastDate(source.getLastDate());
                    if(source.getCreator()!=null){
                    result.setCreatorName(source.getCreator().getName());
                    }
                    result.setId(source.getId());
                    result.setConsumeTime(source.getConsumeTime());
                    result.setAddDate(source.getAddDate());
                    if(source.getCreator()!=null){
                    result.setCreator(source.getCreator().getId());
                    }


    return result;
  }

}